﻿define(function (require, exports, module) {
    var m_cache = {};

    exports.GetAsync = function (src) {
        return Wind.Async.Task.create(function (t) {
            if (m_cache.hasOwnProperty(src)) {
                t.complete('success', m_cache[src]);
            }
            else {
                var img = new Image();
                $(img).load(function () {
                    m_cache[src] = img;
                    t.complete('success', img);
                }).error(function () {
                    t.complete('failure', '加载图片' + src + '失败!');
                }).attr('src', src);
            }
        });
    };
});